<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="fixed-table-toolbar">
                    <div class="columns pull-left">
                        <button shiro:hasPermission="market:channelProfit:add" type="button" class="btn  btn-primary"
                                onclick="add()">
                            <i class="fa fa-plus" aria-hidden="true"></i>新建收益
                        </button>
                        <button shiro:hasPermission="market:channelProfit:batchRemove" type="button"
                                class="btn  btn-danger"
                                onclick="batchRemove()">
                            <i class="fa fa-trash" aria-hidden="true"></i>删除收益
                        </button>
                        <button shiro:hasPermission="market:channelProfit:batchPublish;" type="button"
                                class="btn  btn-success"
                                onclick="batchPublish()">
                            <i class="fa fa-trash" aria-hidden="true"></i>发布收益
                        </button>
                        <button shiro:hasPermission="market:channelProfit:exportExcel;" type="button"
                                class="btn  btn-success"
                                onclick="exportExcel()">
                            <i class="fa fa-trash" aria-hidden="true"></i>导出表格
                        </button>
                    </div>
                    <div class="columns pull-right">
                        <button class="btn btn-success" onclick="reLoad()">查询</button>
                    </div>
                    <div class="columns pull-right col-md-2 nopadding">
                        <select id="publishstate" class="form-control">
                            <option value="">-- 请选择发布状态 --</option>
                            <option value="0">未发布</option>
                            <option value="1">已发布</option>
                        </select>
                    </div>
                    <div class="columns pull-right col-md-2 nopadding">
                        <label class="sr-only">结束时间</label>
                        <input type="text" id="endTime" name="endTime" class="form-control" placeholder="请选择结束时间"
                               required="required" readonly="readonly"
                               aria-required="true"/>
                    </div>
                    <div class="columns pull-right col-md-2 nopadding">
                        <label class="sr-only">开始时间</label>
                        <input type="text" id="beginTime" name="beginTime" class="form-control" placeholder="请选择开始时间"
                               readonly="readonly"
                               required="required" aria-required="true"/>
                    </div>
                </div>
                <table id="exampleTable" data-mobile-responsive="true">
                </table>
            </div>
        </div>
    </div>
</div>
<!--shiro控制bootstraptable行内按钮看见性 来自bootdo的创新方案 -->
<div>
    <script type="text/javascript">
        var s_edit_h = 'hidden';
        var s_remove_h = 'hidden';
        var s_resetPwd_h = 'hidden';
    </script>
</div>
<div shiro:hasPermission="market:channelProfit:edit">
    <script type="text/javascript">
        s_edit_h = '';
    </script>
</div>
<div shiro:hasPermission="market:channelProfit:remove">
    <script type="text/javascript">
        var s_remove_h = '';
    </script>
</div>
<div shiro:hasPermission="market:channelProfit:resetPwd">
    <script type="text/javascript">
        var s_resetPwd_h = '';
    </script>
</div>
</div>
<div th:include="include :: footer"></div>
<script type="text/javascript" src="/js/appjs/market/channelProfit/channelProfit.js"></script>
<link rel="stylesheet" href="@{/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css}"
      th:href="@{/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css}">
<script th:src="@{/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js}"></script>
<script th:src="@{/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js}"></script>
<script type="text/javascript" th:inline="javascript">
    $(function () {
        $("#beginTime").datetimepicker({//选择年月日
            format: 'yyyy-mm-dd',
            language: 'zh-CN',
            weekStart: 1,
            todayBtn: 1,//显示‘今日’按钮
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            minView: 2,  //Number, String. 默认值：0, 'hour'，日期时间选择器所能够提供的最精确的时间选择视图。
            clearBtn: true,//清除按钮
            forceParse: 0
        }).on("click", function () {
            $("#beginTime").datetimepicker("setEndDate", $("#endTime").val());
        });
        $("#endTime").datetimepicker({//选择年月日
            format: 'yyyy-mm-dd',
            language: 'zh-CN',
            weekStart: 1,
            todayBtn: 1,//显示‘今日’按钮
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            minView: 2,  //Number, String. 默认值：0, 'hour'，日期时间选择器所能够提供的最精确的时间选择视图。
            clearBtn: true,//清除按钮
            forceParse: 0
        }).on("click", function () {
            $("#endTime").datetimepicker("setStartDate", $("#beginTime").val());
        });
    })


</script>
</body>
</html>